﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace SomeGame.Actors.Components.Movement {

	public class ZombieMovement : ActorComponent {

		public const float WALKING_SPEED = 30;
		public float CurrentSpeed; // Pixels per second.
		private Vector2 currentDirection;
		public Vector2 CurrentDirection {
			get { return currentDirection; }
			set { currentDirection = value != Vector2.Zero ? Vector2.Normalize(value) : value; }
		}
		private readonly Body Body; // Moved by this component.

		public ZombieMovement(Body body) {
			Body = body;
		}

		public override void Update(GameTime gameTime, bool parallax) {
			if (CurrentSpeed > 0) {
				Body.Position += CurrentDirection*(float)(CurrentSpeed*gameTime.ElapsedGameTime.TotalSeconds);
			}
		}

	}

}